package ca.tatham.senssim.pddd;

import ca.tatham.senssim.AbstractPacket;
import ca.tatham.senssim.Packet;
import ca.tatham.senssim.util.Address;

public class UpdatePacket extends AbstractPacket implements Packet
{
  private final Level m_level;

  protected UpdatePacket(Address source, Address sinkAddress, Level level)
  {
    super(source, Address.BROADCAST, sinkAddress);
    m_level = level;
  }

  public Level getLevel()
  {
    return m_level;
  }

  public int getSize()
  {
    return getSource().sizeOf() + getDestination().sizeOf()
        + getLevel().sizeOf() + getSinkAddress().sizeOf() + 8;
  }

}
